<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
 <head>
  <meta http-equiv="content-type" content="text/html; charset=UTF-8">
  <title>Convert LDAP error number into string error message</title>
 </head>
 <body class="docs"><div id="layout">
  <div id="layout-content"><div id="function.ldap-err2str" class="refentry">
 <div class="refnamediv">
  <h1 class="refname">ldap_err2str</h1>
  <p class="verinfo">(PHP 4, PHP 5, PHP 7)</p><p class="refpurpose"><span class="refname">ldap_err2str</span> &mdash; <span class="dc-title">Convert LDAP error number into string error message</span></p>

 </div>
 
 <div class="refsect1 description" id="refsect1-function.ldap-err2str-description">
  <h3 class="title">说明</h3>
  <div class="methodsynopsis dc-description">
   <span class="methodname"><strong>ldap_err2str</strong></span>
    ( <span class="methodparam"><span class="type">int</span> <code class="parameter">$errno</code></span>
   ) : <span class="type">string</span></div>

  <p class="para rdfs-comment">
   Returns the string error message explaining the error number
   <code class="parameter">errno</code>. While LDAP errno numbers are standardized,
   different libraries return different or even localized textual error
   messages. Never check for a specific error message text, but always use an
   error number to check.
  </p>
 </div>


 <div class="refsect1 parameters" id="refsect1-function.ldap-err2str-parameters">
  <h3 class="title">参数</h3>
  <p class="para">
   <dl>

    
     <dt>
<code class="parameter">errno</code></dt>

     <dd>

      <p class="para">
       The error number.
      </p>
     </dd>

    
   </dl>

  </p>
 </div>


 <div class="refsect1 returnvalues" id="refsect1-function.ldap-err2str-returnvalues">
  <h3 class="title">返回值</h3>
  <p class="para">
   Returns the error message, as a string.
  </p>
 </div>


 <div class="refsect1 examples" id="refsect1-function.ldap-err2str-examples">
  <h3 class="title">范例</h3>
  <p class="para">
   <div class="example" id="example-5394">
    <p><strong>Example #1 Enumerating all LDAP error messages</strong></p>
    <div class="example-contents">
<div class="phpcode"><pre><span style="color: #000000">
<span style="color: #0000BB">&lt;?php<br />&nbsp;&nbsp;</span><span style="color: #007700">for&nbsp;(</span><span style="color: #0000BB">$i</span><span style="color: #007700">=</span><span style="color: #0000BB">0</span><span style="color: #007700">;&nbsp;</span><span style="color: #0000BB">$i</span><span style="color: #007700">&lt;</span><span style="color: #0000BB">100</span><span style="color: #007700">;&nbsp;</span><span style="color: #0000BB">$i</span><span style="color: #007700">++)&nbsp;{<br />&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">printf</span><span style="color: #007700">(</span><span style="color: #DD0000">"Error&nbsp;</span><span style="color: #0000BB">$i</span><span style="color: #DD0000">:&nbsp;%s&lt;br&nbsp;/&gt;\n"</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">ldap_err2str</span><span style="color: #007700">(</span><span style="color: #0000BB">$i</span><span style="color: #007700">));<br />&nbsp;&nbsp;}<br /></span><span style="color: #0000BB">?&gt;</span>
</span>
</pre></div>
    </div>

   </div>
  </p>
 </div>


 <div class="refsect1 seealso" id="refsect1-function.ldap-err2str-seealso">
  <h3 class="title">参见</h3>
  <p class="para">
   <ul class="simplelist">
    <li class="member"><span class="function"><a href="ldap_errno.html" class="function" rel="rdfs-seeAlso">ldap_errno()</a> - Return the LDAP error number of the last LDAP command</span></li>
    <li class="member"><span class="function"><a href="ldap_error.html" class="function" rel="rdfs-seeAlso">ldap_error()</a> - Return the LDAP error message of the last LDAP command</span></li>
   </ul>
  </p>
 </div>


</div></div></div></body></html>